package com.boang.service.impl;

import jakarta.annotation.Resource;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

/**
 * @author 13813
 */

@Service
public class CaptchaService {

    @Resource
    private StringRedisTemplate stringRedisTemplate;

    public boolean validateCaptcha(String userInputCaptcha) {
        String kaptcha = stringRedisTemplate.opsForValue().get("kaptcha");
        return userInputCaptcha.equalsIgnoreCase(kaptcha);
    }
}